﻿using SlamDunk.CMS.Model.Base;
using SlamDunk.CMS.Model.ViewModel;

namespace SlamDunk.CMS.Model.DataModel
{
    /// <summary>
    /// 本科分数线
    /// </summary>
    public class ScoreLine : BaseEntity
    {
        #region # 属性

        #region 省份 —— string Province
        /// <summary>
        /// 省份
        /// </summary>
        public string Province { get; set; }
        #endregion

        #region 年份 —— short Year
        /// <summary>
        /// 年份
        /// </summary>
        public short Year { get; set; }
        #endregion

        #region 专业 —— string Major
        /// <summary>
        /// 专业
        /// </summary>
        public string Major { get; set; }
        #endregion

        #region 类别代码 —— string Category
        /// <summary>
        /// 类别代码
        /// </summary>
        public string Category { get; set; }
        #endregion

        #region 最高分 —— short TopScore
        /// <summary>
        /// 最高分
        /// </summary>
        public short TopScore { get; set; }
        #endregion

        #region 最低分 —— short BottomScore
        /// <summary>
        /// 最低分
        /// </summary>
        public short BottomScore { get; set; }
        #endregion

        #region 平均分 —— short AvgScore
        /// <summary>
        /// 平均分
        /// </summary>
        public short AvgScore { get; set; }
        #endregion

        #region 录取人数 —— short AdmitCount
        /// <summary>
        /// 录取人数
        /// </summary>
        public short AdmitCount { get; set; }
        #endregion

        #endregion

        #region # 方法

        #region 转换为视图模型 —— ScoreLineView ToViewModel()
        /// <summary>
        /// 转换为视图模型
        /// </summary>
        /// <returns>视图模型对象</returns>
        public ScoreLineView ToViewModel()
        {
            return new ScoreLineView()
            {
                Id = this.Id,
                Province = this.Province,
                Year = this.Year,
                Major = this.Major,
                Category = this.Category,
                TopScore = this.TopScore,
                BottomScore = this.BottomScore,
                AvgScore = this.AvgScore,
                AdmitCount = this.AdmitCount,
                AddTime = this.AddTime.ToString("yyyy-MM-dd HH:mm:ss")
            };
        }
        #endregion

        #endregion
    }
}
